import {
  request
} from '../helpers.js';

let debug = process.env.NODE_ENV != 'product';

// 获取数据函数
export const getTableData = function(url, params) {
//  console.log(params);
    return request({
    url: url,
    params: params,
  });
}

export const getInfo = function(url, id) {
  return request({
    url: url + '/' + id,
  })
}

// 编辑函数
export const update = function(url,data,id) {
  return request({
    url: url + '/' + id,
    data: data,
    method: 'put'
  })
}
// 创建函数
export const create = function(url, data) {
  return request({
    url: url,
    data:data,
    method: 'post'
  })
}

// 删除函数
export const del = function(url, id) {
  return request({
    url: url + '/' + id,
    method: 'delete'
  })
}
